//
//  UIView+Helper.h
//  Qraved
//
//  Created by Libo Liu on 10/8/13.
//  Copyright (c) 2013 Imaginato. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIView (Helper)

-(CGFloat)endPointX;
-(CGFloat)endPointY;
-(CGFloat)startPointX;
-(CGFloat)startPointY;

/***
 计算组件的某些位置的坐标
 **/
-(CGFloat) minX;

-(CGFloat) midX;

-(CGFloat) maxX;

-(CGFloat) minY;

-(CGFloat) midY;

-(CGFloat) maxY;

+ (UIView *)initWithFrame:(CGRect)frame backgroundColor:(UIColor *)backgroundColor;


- (void)createBordersWithColor:(UIColor *)color withCornerRadius:(CGFloat)radius andWidth:(CGFloat)width;
- (void)removeBorders;


- (void)createRectShadowWithOffset:(CGSize)offset opacity:(CGFloat)opacity radius:(CGFloat)radius;
- (void)createCornerRadiusShadowWithCornerRadius:(CGFloat)cornerRadius offset:(CGSize)offset opacity:(CGFloat)opacity radius:(CGFloat)radius;
- (void)removeShadow;


- (void)setCornerRadius:(CGFloat)radius;

//Animations
- (void)shakeView;
 - (void)pulseViewWithTime:(CGFloat)seconds;



//用透明度alpha实现颜色渐变
- (void) insertTransparentGradient;
//用颜色实现颜色渐变
- (void) insertColorGradient;

//通过UIView对象获取该对象所属的UIViewController
- (UIViewController*)viewController;





@end
